if (typeof (mediator) == 'undefined')
	mediator = {};

if (typeof (mediator.userLogin) == 'undefined')
	mediator.userLogin = {};

mediator.userLogin.createViewMediator = function() {
	
	$('#sub_lo').submit(function(){
		var user = model.user.initializeViewModel();
		user.username($.trim($('#username').val()));
		user.password($.trim($('#password').val()));
		var result = user.login();
		if (result.success) {
			window.location = "person/space.action?pid=" + result.pid;
		} else {
            $('#lo_info').show();
		}
		return false;
	});

}